1. Field of the invention
This invention relates to a data processing method for a situation in which an exception event has occurred during execution of an application program. The present invention also relates to a computer-readable recording medium having a program for dealing with exceptions recorded thereon, and an electronic apparatus including a recording medium having a program for dealing with exceptions recorded thereon.
2. Description of Related Art
There are occasions wherein there occurs an exception event in the course of execution of an application program. The exception event is such as event as causes interruption of normal execution of an application program, such as overflow in the calculated results.
Usually, an application program is executed using an operating system as software and a processor as hardware. The exception events are classed into those of computational processing by the processor, referred to hereinafter as hardware exceptions, and those of processing by the operating system, referred to hereinafter as software exceptions.
The processing in case of occurrence of the hardware exception or software exception is explained with reference to FIG. 1.
If hardware exceptions occur, a specified exception processing unit is responsive thereto to carry out exception processing. This exception processing is supplied by the operating system. On occurrence of hardware exceptions, the exception processing unit receives from the processor a message specifying the occurrence of hardware exceptions. The message specifying the exception occurrence is defined by the processor architecture. On reception of the message specifying the exception occurrence from the processor, the exception processing unit analyzes this message to furnish to the application program the exception service associated with the exception event specified by the message specifying the exception occurrence. The services furnished by the application program are those defined by the operating system and are usually not dependant on the processor architecture.
Thus, the exception processor of the operating system on reception of the exception occurrence message defined by the processor architecture furnishes the exception service defined by the operating system to the application program. It is noted that the exception services furnished to the application program are usually not dependant on the processor architecture. Therefore, the exception processing portion of the operating system includes a processor architecture dependent portion and a processor architecture independent portion existing together.
If software exceptions are produced, a specified exception processing portion is executed in response thereto. This exception processing portion is furnished by the operating system. On occurrence of the software exceptions, an exception occurrence message, specifying the occurrence of the software exception, is delivered to the exception processing portion from the routine processing portion responsible for routine processing in the operating system. The exception occurrence message is defined by the operating system. The exception processing portion analyzes the exception occurrence message received from the routine processing portion to furnish the exception service corresponding to the exception event specified by the exception occurrence message to the application program. The exception service furnished to the application program is that defined by the operating system and is usually independent of the processor architecture.
If an exception event has occurred, it needs to be responsive to the requests or properties of the application program regarding which services should be furnished from the operating system to the application program. It is therefore required of the operating system to have an exception processing portion having an interface which meets with the properties or requests of different application programs. That is, for satisfying properties or requests of a variety of the application programs, it is required of the operating system to have plural different interfaces as interfaces pertinent to exception processing. The environments furnished by the exception processing portions of different interfaces are herein termed `exception processing environments`.
As a method for furnishing a plurality of different exception processing environments, there is a method for emulating the exception processing environment, as shown in FIG. 2. At this time, the operating system furnishes, as a principle, only a sole exception processing environment on which a software module furnishing another exception processing environment is superimposed as an emulator by way of emulation of the other exception processing environment.
This method can be implemented relatively easily when it is attempted to furnish plural exception processing environments on an operating system furnishing only a sole exception processing environment. However, there is raised a problem that the speed of execution is retarded due to the load caused by applying the additional software module for emulation. There is also raised a problem that it is difficult to add dynamically plural exception processing environments.
There may be contemplated a method for overcoming the problem inherent in the method for emulating the exception processing environment to furnish plural exception processing environments by the operating system simultaneously. The present Assignee has already proposed a data processing method and apparatus implementing plural environments in Japanese Patent Application HEI-No.8-67881.
If the operating system furnishes plural exception processing environments simultaneously, the respective exception processing environments depend on the processor architecture. Specifically, on occurrence of hardware exceptions, each exception processing environment receives the exception occurrence message defined by the processor architecture to furnish the exception service corresponding to the exception event specified by the exception occurrence specifying message, so that each exception processing environment is dependent on the processor architecture.
However, if each exception processing environment is dependent on the processor architecture, it becomes necessary to take the processor architecture for each of the exception processing environments into account thus increasing the labor required in furnishing the exception processing environments. That is, if desired to furnish plural exception processing environments simultaneously by the operating system, a lot of labor is required in assembling plural exception processing environments because of the necessity of taking the processor architecture into account for each of the exception processing environments.